#!/bin/bash

# 停止旧进程
PID=$(pgrep -f helio-boot-2.3.1.jar)
if [ -n "$PID" ]; then
    echo "Stopping existing process with PID $PID..."
    kill -15 $PID
    sleep 5  # 等待进程关闭
fi

# 启动新进程
echo "Starting new instance..."
nohup java -jar helio-boot-2.4.0.jar > your-app.log 2>&1 &
echo "Restarted successfully."